home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1999 March / EnigmA AMIGA RUN 35 (1999)(G.R. Edizioni)(IT)[!][issue 1999-03].iso / earcd / devel / vbcc-68k-src / machines / amiga68k / libsrc / math / math_040 / modf.c < prev    next >
C/C++ Source or Header  |  1999-01-01  |  170b  |  13 lines

  1. #include <math.h>
  2.  
  3. double modf(double x,double *p)
  4. {
  5.     if(x<0){
  6.         *p=ceil(x);
  7.         return(*p-x);
  8.     }else{
  9.         *p=floor(x);
  10.         return(x-*p);
  11.     }
  12. }
  13.